package com.zone.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zone.demo.domain.entity.Myuser;
import com.zone.demo.domain.mapper.MyuserMapper;
import com.zone.demo.service.IMyuserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author MMinbo
 * @since 2019-10-25
 */
@Service
public class MyuserServiceImpl extends ServiceImpl<MyuserMapper, Myuser> implements IMyuserService {

	@Override
	public Myuser getUserByName(String name) {
		return this.baseMapper.getUserByName(name);
	}

	@Override
	public void deleteUserByName(String name) {
		this.baseMapper.deleteUserByName(name);
	}


	@Override
	public void updateUserById( Long id ,String name, int age, String email) {
		this.baseMapper.updateUserById(id,name,age,email);
	}

	@Override
	public Myuser getUserById(Long id) {
		return baseMapper.getUserById(id);
	}

	@Override
	public void addUser(Long id,String name, int age, String email) {
		this.baseMapper.addUser(id,name,age,email);
	}
	@Override
	public int add(Integer initial, int loop) {
		int sum =0;
		for(int i = initial;i<loop; i++){
			sum = sum + i;
		}
		return sum;
	}
}
